//
// CSceneUser.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;

public class CSceneUser {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CSceneUser(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CSceneUser obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CSceneUser(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CSceneUser(CDriverUser drv, boolean bSmallScene) {
    this(nel3dJNI.new_CSceneUser(CDriverUser.getCPtr(drv), drv, bSmallScene), true);
  }

  public void render(boolean updateWaitingInstances, boolean restoreMatrixContextAfterRender) {
    nel3dJNI.CSceneUser_render__SWIG_0(swigCPtr, this, updateWaitingInstances, restoreMatrixContextAfterRender);
  }

  public void render(boolean updateWaitingInstances) {
    nel3dJNI.CSceneUser_render__SWIG_1(swigCPtr, this, updateWaitingInstances);
  }

  public void render() {
    nel3dJNI.CSceneUser_render__SWIG_2(swigCPtr, this);
  }

  public void beginPartRender() {
    nel3dJNI.CSceneUser_beginPartRender(swigCPtr, this);
  }

  public void renderPart(SWIGTYPE_p_TRenderPart rp) {
    nel3dJNI.CSceneUser_renderPart(swigCPtr, this, SWIGTYPE_p_TRenderPart.getCPtr(rp));
  }

  public void endPartRender(boolean updateWaitingInstances, boolean restoreMatrixContextAfterRender) {
    nel3dJNI.CSceneUser_endPartRender__SWIG_0(swigCPtr, this, updateWaitingInstances, restoreMatrixContextAfterRender);
  }

  public void endPartRender(boolean updateWaitingInstances) {
    nel3dJNI.CSceneUser_endPartRender__SWIG_1(swigCPtr, this, updateWaitingInstances);
  }

  public void endPartRender() {
    nel3dJNI.CSceneUser_endPartRender__SWIG_2(swigCPtr, this);
  }

  public void updateWaitingInstances(double ellapsedTime) {
    nel3dJNI.CSceneUser_updateWaitingInstances(swigCPtr, this, ellapsedTime);
  }

  public void animate(double time) {
    nel3dJNI.CSceneUser_animate(swigCPtr, this, time);
  }

  public void setCam(UCamera cam) {
    nel3dJNI.CSceneUser_setCam(swigCPtr, this, UCamera.getCPtr(cam), cam);
  }

  public UCamera getCam() {
    return new UCamera(nel3dJNI.CSceneUser_getCam(swigCPtr, this), true);
  }

  public void setViewport(CViewport viewport) {
    nel3dJNI.CSceneUser_setViewport(swigCPtr, this, CViewport.getCPtr(viewport), viewport);
  }

  public CViewport getViewport() {
    return new CViewport(nel3dJNI.CSceneUser_getViewport(swigCPtr, this), true);
  }

  public UInstanceGroup findCameraClusterSystemFromRay(UInstanceGroup startClusterSystem, CVector startPos, CVector endPos) {
    long cPtr = nel3dJNI.CSceneUser_findCameraClusterSystemFromRay(swigCPtr, this, UInstanceGroup.getCPtr(startClusterSystem), startClusterSystem, CVector.getCPtr(startPos), startPos, CVector.getCPtr(endPos), endPos);
    return (cPtr == 0) ? null : new UInstanceGroup(cPtr, false);
  }

  public UCamera createCamera() {
    return new UCamera(nel3dJNI.CSceneUser_createCamera(swigCPtr, this), true);
  }

  public void deleteCamera(UCamera cam) {
    nel3dJNI.CSceneUser_deleteCamera(swigCPtr, this, UCamera.getCPtr(cam), cam);
  }

  public UInstance createInstance(String shapeName) {
    return new UInstance(nel3dJNI.CSceneUser_createInstance(swigCPtr, this, shapeName), true);
  }

  public void createInstanceAsync(String shapeName, UInstance ppInstance, CVector position, long selectedTexture) {
    nel3dJNI.CSceneUser_createInstanceAsync(swigCPtr, this, shapeName, UInstance.getCPtr(ppInstance), ppInstance, CVector.getCPtr(position), position, selectedTexture);
  }

  public void deleteInstance(UInstance inst) {
    nel3dJNI.CSceneUser_deleteInstance(swigCPtr, this, UInstance.getCPtr(inst), inst);
  }

  public void createInstanceGroupAndAddToSceneAsync(String instanceGroup, SWIGTYPE_p_p_NL3D__UInstanceGroup pIG, CVector pos, SWIGTYPE_p_NLMISC__CQuat rot, long selectedTexture, IAsyncLoadCallback pCB) {
    nel3dJNI.CSceneUser_createInstanceGroupAndAddToSceneAsync__SWIG_0(swigCPtr, this, instanceGroup, SWIGTYPE_p_p_NL3D__UInstanceGroup.getCPtr(pIG), CVector.getCPtr(pos), pos, SWIGTYPE_p_NLMISC__CQuat.getCPtr(rot), selectedTexture, IAsyncLoadCallback.getCPtr(pCB), pCB);
  }

  public void createInstanceGroupAndAddToSceneAsync(String instanceGroup, SWIGTYPE_p_p_NL3D__UInstanceGroup pIG, CVector pos, SWIGTYPE_p_NLMISC__CQuat rot, long selectedTexture) {
    nel3dJNI.CSceneUser_createInstanceGroupAndAddToSceneAsync__SWIG_1(swigCPtr, this, instanceGroup, SWIGTYPE_p_p_NL3D__UInstanceGroup.getCPtr(pIG), CVector.getCPtr(pos), pos, SWIGTYPE_p_NLMISC__CQuat.getCPtr(rot), selectedTexture);
  }

  public void stopCreatingAndAddingIG(SWIGTYPE_p_p_NL3D__UInstanceGroup pIG) {
    nel3dJNI.CSceneUser_stopCreatingAndAddingIG(swigCPtr, this, SWIGTYPE_p_p_NL3D__UInstanceGroup.getCPtr(pIG));
  }

  public void deleteInstanceGroup(UInstanceGroup pIG) {
    nel3dJNI.CSceneUser_deleteInstanceGroup(swigCPtr, this, UInstanceGroup.getCPtr(pIG), pIG);
  }

  public void updateWaitingIG() {
    nel3dJNI.CSceneUser_updateWaitingIG(swigCPtr, this);
  }

  public UTransform createTransform() {
    return new UTransform(nel3dJNI.CSceneUser_createTransform(swigCPtr, this), true);
  }

  public void deleteTransform(UTransform tr) {
    nel3dJNI.CSceneUser_deleteTransform(swigCPtr, this, UTransform.getCPtr(tr), tr);
  }

  public USkeleton createSkeleton(String shapeName) {
    return new USkeleton(nel3dJNI.CSceneUser_createSkeleton(swigCPtr, this, shapeName), true);
  }

  public void deleteSkeleton(USkeleton skel) {
    nel3dJNI.CSceneUser_deleteSkeleton(swigCPtr, this, USkeleton.getCPtr(skel), skel);
  }

  public ULandscape createLandscape() {
    long cPtr = nel3dJNI.CSceneUser_createLandscape(swigCPtr, this);
    return (cPtr == 0) ? null : new ULandscape(cPtr, false);
  }

  public void deleteLandscape(ULandscape land) {
    nel3dJNI.CSceneUser_deleteLandscape(swigCPtr, this, ULandscape.getCPtr(land), land);
  }

  public UCloudScape createCloudScape() {
    long cPtr = nel3dJNI.CSceneUser_createCloudScape(swigCPtr, this);
    return (cPtr == 0) ? null : new UCloudScape(cPtr, false);
  }

  public void deleteCloudScape(UCloudScape cs) {
    nel3dJNI.CSceneUser_deleteCloudScape(swigCPtr, this, UCloudScape.getCPtr(cs), cs);
  }

  public void setToGlobalInstanceGroup(UInstanceGroup pIG) {
    nel3dJNI.CSceneUser_setToGlobalInstanceGroup(swigCPtr, this, UInstanceGroup.getCPtr(pIG), pIG);
  }

  public UPointLight createPointLight() {
    return new UPointLight(nel3dJNI.CSceneUser_createPointLight(swigCPtr, this), true);
  }

  public void deletePointLight(UPointLight light) {
    nel3dJNI.CSceneUser_deletePointLight(swigCPtr, this, UPointLight.getCPtr(light), light);
  }

  public void setAutomaticAnimationSet(UAnimationSet as) {
    nel3dJNI.CSceneUser_setAutomaticAnimationSet(swigCPtr, this, UAnimationSet.getCPtr(as), as);
  }

  public UPlayListManager createPlayListManager() {
    long cPtr = nel3dJNI.CSceneUser_createPlayListManager(swigCPtr, this);
    return (cPtr == 0) ? null : new UPlayListManager(cPtr, false);
  }

  public void deletePlayListManager(UPlayListManager playListManager) {
    nel3dJNI.CSceneUser_deletePlayListManager(swigCPtr, this, UPlayListManager.getCPtr(playListManager), playListManager);
  }

  public UVisualCollisionManager createVisualCollisionManager() {
    long cPtr = nel3dJNI.CSceneUser_createVisualCollisionManager(swigCPtr, this);
    return (cPtr == 0) ? null : new UVisualCollisionManager(cPtr, false);
  }

  public void deleteVisualCollisionManager(UVisualCollisionManager mgr) {
    nel3dJNI.CSceneUser_deleteVisualCollisionManager(swigCPtr, this, UVisualCollisionManager.getCPtr(mgr), mgr);
  }

  public void setPolygonBalancingMode(SWIGTYPE_p_TPolygonBalancingMode polBalMode) {
    nel3dJNI.CSceneUser_setPolygonBalancingMode(swigCPtr, this, SWIGTYPE_p_TPolygonBalancingMode.getCPtr(polBalMode));
  }

  public SWIGTYPE_p_TPolygonBalancingMode getPolygonBalancingMode() {
    return new SWIGTYPE_p_TPolygonBalancingMode(nel3dJNI.CSceneUser_getPolygonBalancingMode(swigCPtr, this), true);
  }

  public float getNbFaceAsked() {
    return nel3dJNI.CSceneUser_getNbFaceAsked(swigCPtr, this);
  }

  public void setGroupLoadMaxPolygon(String group, long nFaces) {
    nel3dJNI.CSceneUser_setGroupLoadMaxPolygon(swigCPtr, this, group, nFaces);
  }

  public long getGroupLoadMaxPolygon(String group) {
    return nel3dJNI.CSceneUser_getGroupLoadMaxPolygon(swigCPtr, this, group);
  }

  public float getGroupNbFaceAsked(String group) {
    return nel3dJNI.CSceneUser_getGroupNbFaceAsked(swigCPtr, this, group);
  }

  public void setMaxSkeletonsInNotCLodForm(long m) {
    nel3dJNI.CSceneUser_setMaxSkeletonsInNotCLodForm(swigCPtr, this, m);
  }

  public long getMaxSkeletonsInNotCLodForm() {
    return nel3dJNI.CSceneUser_getMaxSkeletonsInNotCLodForm(swigCPtr, this);
  }

  public void setCoarseMeshManagerTexture(String sPath) {
    nel3dJNI.CSceneUser_setCoarseMeshManagerTexture(swigCPtr, this, sPath);
  }

  public void setCoarseMeshLightingUpdate(short period) {
    nel3dJNI.CSceneUser_setCoarseMeshLightingUpdate(swigCPtr, this, period);
  }

  public short getCoarseMeshLightingUpdate() {
    return nel3dJNI.CSceneUser_getCoarseMeshLightingUpdate(swigCPtr, this);
  }

  public void setLayersRenderingOrder(boolean directOrder) {
    nel3dJNI.CSceneUser_setLayersRenderingOrder__SWIG_0(swigCPtr, this, directOrder);
  }

  public void setLayersRenderingOrder() {
    nel3dJNI.CSceneUser_setLayersRenderingOrder__SWIG_1(swigCPtr, this);
  }

  public boolean getLayersRenderingOrder() {
    return nel3dJNI.CSceneUser_getLayersRenderingOrder(swigCPtr, this);
  }

  public void enableLightingSystem(boolean enable) {
    nel3dJNI.CSceneUser_enableLightingSystem(swigCPtr, this, enable);
  }

  public void setAmbientGlobal(CRGBA ambient) {
    nel3dJNI.CSceneUser_setAmbientGlobal(swigCPtr, this, CRGBA.getCPtr(ambient), ambient);
  }

  public void setSunAmbient(CRGBA ambient) {
    nel3dJNI.CSceneUser_setSunAmbient(swigCPtr, this, CRGBA.getCPtr(ambient), ambient);
  }

  public void setSunDiffuse(CRGBA diffuse) {
    nel3dJNI.CSceneUser_setSunDiffuse(swigCPtr, this, CRGBA.getCPtr(diffuse), diffuse);
  }

  public void setSunSpecular(CRGBA specular) {
    nel3dJNI.CSceneUser_setSunSpecular(swigCPtr, this, CRGBA.getCPtr(specular), specular);
  }

  public void setSunDirection(CVector direction) {
    nel3dJNI.CSceneUser_setSunDirection(swigCPtr, this, CVector.getCPtr(direction), direction);
  }

  public void setLightGroupColor(long lightmapGroup, CRGBA color) {
    nel3dJNI.CSceneUser_setLightGroupColor(swigCPtr, this, lightmapGroup, CRGBA.getCPtr(color), color);
  }

  public CRGBA getAmbientGlobal() {
    return new CRGBA(nel3dJNI.CSceneUser_getAmbientGlobal(swigCPtr, this), true);
  }

  public CRGBA getSunAmbient() {
    return new CRGBA(nel3dJNI.CSceneUser_getSunAmbient(swigCPtr, this), true);
  }

  public CRGBA getSunDiffuse() {
    return new CRGBA(nel3dJNI.CSceneUser_getSunDiffuse(swigCPtr, this), true);
  }

  public CRGBA getSunSpecular() {
    return new CRGBA(nel3dJNI.CSceneUser_getSunSpecular(swigCPtr, this), true);
  }

  public CVector getSunDirection() {
    return new CVector(nel3dJNI.CSceneUser_getSunDirection(swigCPtr, this), true);
  }

  public void setMaxLightContribution(long nlights) {
    nel3dJNI.CSceneUser_setMaxLightContribution(swigCPtr, this, nlights);
  }

  public long getMaxLightContribution() {
    return nel3dJNI.CSceneUser_getMaxLightContribution(swigCPtr, this);
  }

  public void setLightTransitionThreshold(float lightTransitionThreshold) {
    nel3dJNI.CSceneUser_setLightTransitionThreshold(swigCPtr, this, lightTransitionThreshold);
  }

  public float getLightTransitionThreshold() {
    return nel3dJNI.CSceneUser_getLightTransitionThreshold(swigCPtr, this);
  }

  public void setGlobalWindPower(float gwp) {
    nel3dJNI.CSceneUser_setGlobalWindPower(swigCPtr, this, gwp);
  }

  public float getGlobalWindPower() {
    return nel3dJNI.CSceneUser_getGlobalWindPower(swigCPtr, this);
  }

  public void setGlobalWindDirection(CVector gwd) {
    nel3dJNI.CSceneUser_setGlobalWindDirection(swigCPtr, this, CVector.getCPtr(gwd), gwd);
  }

  public CVector getGlobalWindDirection() {
    return new CVector(nel3dJNI.CSceneUser_getGlobalWindDirection(swigCPtr, this), false);
  }

  public void resetCLodManager() {
    nel3dJNI.CSceneUser_resetCLodManager(swigCPtr, this);
  }

  public long loadCLodShapeBank(String fileName) {
    return nel3dJNI.CSceneUser_loadCLodShapeBank(swigCPtr, this, fileName);
  }

  public void deleteCLodShapeBank(long bankId) {
    nel3dJNI.CSceneUser_deleteCLodShapeBank(swigCPtr, this, bankId);
  }

  public int getCLodShapeIdByName(String name) {
    return nel3dJNI.CSceneUser_getCLodShapeIdByName(swigCPtr, this, name);
  }

  public int getCLodAnimIdByName(long shapeId, String name) {
    return nel3dJNI.CSceneUser_getCLodAnimIdByName(swigCPtr, this, shapeId, name);
  }

  public void enableElementRender(SWIGTYPE_p_TRenderFilter elt, boolean state) {
    nel3dJNI.CSceneUser_enableElementRender(swigCPtr, this, SWIGTYPE_p_TRenderFilter.getCPtr(elt), state);
  }

  public void profileNextRender() {
    nel3dJNI.CSceneUser_profileNextRender(swigCPtr, this);
  }

  public void getProfileResults(SWIGTYPE_p_CBenchResults results) {
    nel3dJNI.CSceneUser_getProfileResults(swigCPtr, this, SWIGTYPE_p_CBenchResults.getCPtr(results));
  }

  public void profileQuadGridClipManager() {
    nel3dJNI.CSceneUser_profileQuadGridClipManager(swigCPtr, this);
  }

  public long getNumFlareContexts() {
    return nel3dJNI.CSceneUser_getNumFlareContexts(swigCPtr, this);
  }

  public void setFlareContext(long context) {
    nel3dJNI.CSceneUser_setFlareContext(swigCPtr, this, context);
  }

  public long getFlareContext() {
    return nel3dJNI.CSceneUser_getFlareContext(swigCPtr, this);
  }

  public long getShadowMapTextureSize() {
    return nel3dJNI.CSceneUser_getShadowMapTextureSize(swigCPtr, this);
  }

  public void setShadowMapTextureSize(long size) {
    nel3dJNI.CSceneUser_setShadowMapTextureSize(swigCPtr, this, size);
  }

  public long getShadowMapBlurSize() {
    return nel3dJNI.CSceneUser_getShadowMapBlurSize(swigCPtr, this);
  }

  public void setShadowMapBlurSize(long bs) {
    nel3dJNI.CSceneUser_setShadowMapBlurSize(swigCPtr, this, bs);
  }

  public void enableShadowPolySmooth(boolean enable) {
    nel3dJNI.CSceneUser_enableShadowPolySmooth(swigCPtr, this, enable);
  }

  public boolean getEnableShadowPolySmooth() {
    return nel3dJNI.CSceneUser_getEnableShadowPolySmooth(swigCPtr, this);
  }

  public void setShadowMapDistFadeStart(float dist) {
    nel3dJNI.CSceneUser_setShadowMapDistFadeStart(swigCPtr, this, dist);
  }

  public float getShadowMapDistFadeStart() {
    return nel3dJNI.CSceneUser_getShadowMapDistFadeStart(swigCPtr, this);
  }

  public void setShadowMapDistFadeEnd(float dist) {
    nel3dJNI.CSceneUser_setShadowMapDistFadeEnd(swigCPtr, this, dist);
  }

  public float getShadowMapDistFadeEnd() {
    return nel3dJNI.CSceneUser_getShadowMapDistFadeEnd(swigCPtr, this);
  }

  public void setShadowMapMaxCasterInScreen(long num) {
    nel3dJNI.CSceneUser_setShadowMapMaxCasterInScreen(swigCPtr, this, num);
  }

  public long getShadowMapMaxCasterInScreen() {
    return nel3dJNI.CSceneUser_getShadowMapMaxCasterInScreen(swigCPtr, this);
  }

  public void setShadowMapMaxCasterAround(long num) {
    nel3dJNI.CSceneUser_setShadowMapMaxCasterAround(swigCPtr, this, num);
  }

  public long getShadowMapMaxCasterAround() {
    return nel3dJNI.CSceneUser_getShadowMapMaxCasterAround(swigCPtr, this);
  }

  public void setVisualCollisionManagerForShadow(UVisualCollisionManager vcm) {
    nel3dJNI.CSceneUser_setVisualCollisionManagerForShadow(swigCPtr, this, UVisualCollisionManager.getCPtr(vcm), vcm);
  }

  public void setWaterCallback(IWaterSurfaceAddedCallback wcb) {
    nel3dJNI.CSceneUser_setWaterCallback(swigCPtr, this, IWaterSurfaceAddedCallback.getCPtr(wcb), wcb);
  }

  public IWaterSurfaceAddedCallback getWaterCallback() {
    long cPtr = nel3dJNI.CSceneUser_getWaterCallback(swigCPtr, this);
    return (cPtr == 0) ? null : new IWaterSurfaceAddedCallback(cPtr, false);
  }

  public void setLandscapePolyDrawingCallback(ILandscapePolyDrawingCallback lpd) {
    nel3dJNI.CSceneUser_setLandscapePolyDrawingCallback(swigCPtr, this, ILandscapePolyDrawingCallback.getCPtr(lpd), lpd);
  }

  public ILandscapePolyDrawingCallback getLandscapePolyDrawingCallback() {
    long cPtr = nel3dJNI.CSceneUser_getLandscapePolyDrawingCallback(swigCPtr, this);
    return (cPtr == 0) ? null : new ILandscapePolyDrawingCallback(cPtr, false);
  }

  public void setupTransparencySorting(short maxPriority, long NbDistanceEntries) {
    nel3dJNI.CSceneUser_setupTransparencySorting__SWIG_0(swigCPtr, this, maxPriority, NbDistanceEntries);
  }

  public void setupTransparencySorting(short maxPriority) {
    nel3dJNI.CSceneUser_setupTransparencySorting__SWIG_1(swigCPtr, this, maxPriority);
  }

  public void setupTransparencySorting() {
    nel3dJNI.CSceneUser_setupTransparencySorting__SWIG_2(swigCPtr, this);
  }

  public void setWaterEnvMap(UWaterEnvMap waterEnvMap) {
    nel3dJNI.CSceneUser_setWaterEnvMap(swigCPtr, this, UWaterEnvMap.getCPtr(waterEnvMap), waterEnvMap);
  }

  public UWaterEnvMap getWaterEnvMap() {
    long cPtr = nel3dJNI.CSceneUser_getWaterEnvMap(swigCPtr, this);
    return (cPtr == 0) ? null : new UWaterEnvMap(cPtr, false);
  }

  public void updateWaterEnvMaps(double time) {
    nel3dJNI.CSceneUser_updateWaterEnvMaps(swigCPtr, this, time);
  }

  public CScene getScene() {
    return new CScene(nel3dJNI.CSceneUser_getScene(swigCPtr, this), false);
  }

}
